package com.dce.dev.api.controller.sample;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.dce.dev.api.common.tools.JsonFileTool;
import com.dce.dev.api.common.tools.json.JsonUtils;
import com.dce.dev.api.dto.base.ResultDTO;
import com.dce.dev.api.dto.sample.SampleDTO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


/**
 * 示例接口
 */
@RestController
@RequestMapping("/sample")
@Api(value = "后台服务--演示swager", description = "后台服务--演示swager")
public class SampleController {

    /**
     * 查询单个组织
     */
    @RequestMapping(value = "/getone", method = RequestMethod.GET)
    @ApiOperation(value = "查询单个组织")
    public ResultDTO<SampleDTO> getSample() {
        String strJson = JsonFileTool.readJSON("sample/sample.json");
        final SampleDTO sampleDTO = JsonUtils.jsonToPojo(strJson, SampleDTO.class);
        return ResultDTO.success(sampleDTO);
    }
}
